import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/",
      redirect:'/tims/login',
    },
    {
      path: "/tims/home", 
      name: "home",
      component: () => import("@/views/Home.vue"),
      children: [
        {
          path: 'course',
          name: 'course',
          component: () => import('@/views/course/Course.vue'),
          meta: { showBanner: false }
        },
        {
          path: 'classroom',
          name: 'classroom',
          component: () => import('@/views/Classroom.vue'),
          meta: { showBanner: false }
        },
        {
          path: 'announcement',
          name: 'announcement',
          component: () => import('@/views/announcement/Announcement.vue'),
          meta: { showBanner: false }
        },
        {
          path: 'schedule',
          name: 'schedule',
          component: () => import('@/views/Schedule.vue'),
          meta: { showBanner: false }
        },
        {
          path: 'teacher/message',
          name: 'teacherMessage',
          component: () => import('@/views/TeacherMessage.vue'),
          meta: {showBanner: false}
        },
        {
          path: 'teacher/detail',
          name: 'teacherDetail',
          component: () => import('@/views/TeacherDetail.vue'),
          meta: {showBanner: false}
        },
      ]
    },
    {
      path: "/tims/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: "/tims/announcementDetails",
      name: "announcementDetails",
      component: () => import("@/views/announcement/AnnouncementDetails.vue"),
    },
    {
      path: "/tims/classroomDetails",
      name: "classroomDetails",
      component: () => import("@/views/ClassroomDetails.vue"),
    },
    {
      path: "/tims/courseDetails",
      name: "courseDetails",
      component: () => import("@/views/course/CourseDetails.vue"),
    },
    {
      path: "/tims/anwser",
      name: "anwser",
      component: () => import("@/views/Answer.vue"),
    },
    {
      path: "/tims/playBack",
      name: "playBack",
      component: () => import("@/views/PlayBack.vue"),
    },
  ]
})

export default router